<?php
class Model_Common extends Model{

   public function upload_file($filepath,$upFilePath,$image=''){
        if(file_exists($filepath)){

            $result=move_uploaded_file($filepath,$upFilePath);

        }
        if($result==true){

            if (is_file($image)){

              unlink ($image);
            }

            return true;
        }else{

            return false;
        }
    }
}
?>